package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.Accessories;
import com.java.manage.service.AccessoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/accessories")
public class AccessoriesController {
    //采购配件管理
    @Autowired
    private AccessoriesService accessoriesService;

    @PostMapping("/list")
    public Result list(@RequestBody Accessories accessories) {
        return accessoriesService.list(accessories);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Accessories accessories) {
        return accessoriesService.save(accessories);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Accessories accessories) {
        return accessoriesService.modify(accessories);
    }

    @PostMapping("/remove")
    public Result remove(int[] ids) {
        return accessoriesService.remove(ids);
    }

    /**
     * 查询类型
     * @return
     */
    @PostMapping("/listSupply")
    public Result listSupply() {
        return accessoriesService.listSupply();
    }


    @GetMapping("/change")
    public Result change(Integer id){
        return accessoriesService.change(id);
    }
    @GetMapping("/replace")
    public Result replace(Integer id){
        return accessoriesService.replace(id);
    }
}
